package pro.lepers.portfolio.view.contents {
	import fr.digitas.flowearth.mvc.address.structs.INode;

	import pro.lepers.portfolio.event.ContentEvent;

	import flash.display.Sprite;

	/**
	 * @author plepers
	 */
	public class AbstractContent extends Sprite {

		
		protected var _w : int;
		protected var _h : int;
		protected var _node : INode;

		public function dispose () : void {
			_dispose( );
		}

		public function setDatas ( datas : XML ) : void {
			// abstract
		}
		
		public function setNode( node : INode ) : void {
			_node = node;
		}

		public function setSize ( w : int, h : int) : void {
			
			_h = h;
			_w = w;
		}

		
		public function close () : void {
			_closed( );
		}

		
		protected function _dispose () : void {
			throw new Error( "AbstractContent - dispose must be overrided by sub classes" );
		}

		protected function _closed () : void {
			dispatchEvent( new ContentEvent( ContentEvent.CLOSED, this ) );
		}
		
		public function get node () : INode {
			return _node;
		}
	}
}
